.class Lcom/tendcloud/tenddata/ed$b;
.super Lcom/tendcloud/tenddata/k;


# instance fields
.field final synthetic e:Lcom/tendcloud/tenddata/ed;


# direct methods
.method constructor <init>(Lcom/tendcloud/tenddata/ed;Ljava/net/URI;ILjava/net/Socket;)V
    .locals 2

    iput-object p1, p0, Lcom/tendcloud/tenddata/ed$b;->e:Lcom/tendcloud/tenddata/ed;

    new-instance v0, Lcom/tendcloud/tenddata/n;

    invoke-direct {v0}, Lcom/tendcloud/tenddata/n;-><init>()V

    const/4 v1, 0x0

    invoke-direct {p0, p2, v0, v1, p3}, Lcom/tendcloud/tenddata/k;-><init>(Ljava/net/URI;Lcom/tendcloud/tenddata/l;Ljava/util/Map;I)V

    invoke-virtual {p0, p4}, Lcom/tendcloud/tenddata/ed$b;->setSocket(Ljava/net/Socket;)V

    return-void
.end method


# virtual methods
.method public b(ILjava/lang/String;Z)V
    .locals 1

    iget-object v0, p0, Lcom/tendcloud/tenddata/ed$b;->e:Lcom/tendcloud/tenddata/ed;

    invoke-static {v0}, Lcom/tendcloud/tenddata/ed;->a(Lcom/tendcloud/tenddata/ed;)Lcom/tendcloud/tenddata/ed$a;

    move-result-object v0

    invoke-interface {v0}, Lcom/tendcloud/tenddata/ed$a;->b()V

    return-void
.end method

.method public onError(Ljava/lang/Exception;)V
    .locals 1

    if-eqz p1, :cond_0

    invoke-virtual {p1}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v0

    if-eqz v0, :cond_0

    :cond_0
    return-void
.end method

.method public onMessage(Ljava/lang/String;)V
    .locals 3

    :try_start_0
    new-instance v0, Lorg/json/JSONObject;

    invoke-direct {v0, p1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    const-string v1, "type"

    invoke-virtual {v0, v1}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "device_info_request"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    iget-object v0, p0, Lcom/tendcloud/tenddata/ed$b;->e:Lcom/tendcloud/tenddata/ed;

    invoke-static {v0}, Lcom/tendcloud/tenddata/ed;->a(Lcom/tendcloud/tenddata/ed;)Lcom/tendcloud/tenddata/ed$a;

    move-result-object v0

    invoke-interface {v0}, Lcom/tendcloud/tenddata/ed$a;->a()V

    :cond_0
    :goto_0
    return-void

    :cond_1
    const-string v2, "snapshot_request"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    iget-object v1, p0, Lcom/tendcloud/tenddata/ed$b;->e:Lcom/tendcloud/tenddata/ed;

    invoke-static {v1}, Lcom/tendcloud/tenddata/ed;->a(Lcom/tendcloud/tenddata/ed;)Lcom/tendcloud/tenddata/ed$a;

    move-result-object v1

    invoke-interface {v1, v0}, Lcom/tendcloud/tenddata/ed$a;->sendSnapshot(Lorg/json/JSONObject;)V

    goto :goto_0

    :catch_0
    move-exception v0

    goto :goto_0

    :cond_2
    const-string v2, "change_request"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_3

    iget-object v1, p0, Lcom/tendcloud/tenddata/ed$b;->e:Lcom/tendcloud/tenddata/ed;

    invoke-static {v1}, Lcom/tendcloud/tenddata/ed;->a(Lcom/tendcloud/tenddata/ed;)Lcom/tendcloud/tenddata/ed$a;

    move-result-object v1

    invoke-interface {v1, v0}, Lcom/tendcloud/tenddata/ed$a;->performEdit(Lorg/json/JSONObject;)V

    goto :goto_0

    :cond_3
    const-string v2, "dynamic_event_request"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_4

    iget-object v1, p0, Lcom/tendcloud/tenddata/ed$b;->e:Lcom/tendcloud/tenddata/ed;

    invoke-static {v1}, Lcom/tendcloud/tenddata/ed;->a(Lcom/tendcloud/tenddata/ed;)Lcom/tendcloud/tenddata/ed$a;

    move-result-object v1

    invoke-interface {v1, v0}, Lcom/tendcloud/tenddata/ed$a;->bindEvents(Lorg/json/JSONObject;)V

    goto :goto_0

    :cond_4
    const-string v2, "clear_request"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_5

    iget-object v1, p0, Lcom/tendcloud/tenddata/ed$b;->e:Lcom/tendcloud/tenddata/ed;

    invoke-static {v1}, Lcom/tendcloud/tenddata/ed;->a(Lcom/tendcloud/tenddata/ed;)Lcom/tendcloud/tenddata/ed$a;

    move-result-object v1

    invoke-interface {v1, v0}, Lcom/tendcloud/tenddata/ed$a;->clearEdits(Lorg/json/JSONObject;)V

    goto :goto_0

    :cond_5
    const-string v2, "tweak_request"

    invoke-virtual {v1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/tendcloud/tenddata/ed$b;->e:Lcom/tendcloud/tenddata/ed;

    invoke-static {v1}, Lcom/tendcloud/tenddata/ed;->a(Lcom/tendcloud/tenddata/ed;)Lcom/tendcloud/tenddata/ed$a;

    move-result-object v1

    invoke-interface {v1, v0}, Lcom/tendcloud/tenddata/ed$a;->setTweaks(Lorg/json/JSONObject;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0
.end method

.method public onOpen(Lcom/tendcloud/tenddata/an;)V
    .locals 1

    const/4 v0, 0x1

    invoke-static {v0}, Lcom/tendcloud/tenddata/ab;->a(Z)V

    return-void
.end method
